<%-- 
    Document   : index
    Created on : 05/08/2013, 09:27:26
    Author     : Cursos Livres
--%>

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Hotel Senac - ECOMMERCER!</title>
        <link rel="stylesheet" type="text/css" href="geral.css" />
    </head>
    <body>
        <div id="geral">
            <h1>Menu</h1>
            <form action="EventoServlet?cmd=pesqNome" method="POST">
                <fieldset>
                    <legend>Pesquisa Evento:</legend>
                    <div>
                        <label>Nome:</label>
                        <input name="nome" type="text" size="35" />
                        <input value="pesquisar" type="submit" />
                    </div>
                </fieldset>


                <c:if test="${!empty eventos}">
                    <table border="1">
                        <tr>
                            <th>Nome</th>                        
                            <th>Artista</th>                        
                            <th>Estilo</th>                        
                            <th>Descrição</th>                        
                            <th>Data Evento</th>
                            <th>Local</th>

                            <th>Excluir</th>
                        </tr>
                        <c:forEach var="evento" items="${eventos}">
                            <tr>
                                <td>
                                    ${evento.nome}
                                </td>
                                <td>
                                    ${evento.artista}
                                </td>
                                <td>
                                    ${evento.estilo}
                                </td>
                                <td>
                                    ${evento.descricao}
                                </td>
                                <td>
                                    ${evento.dataEvento}
                                </td>
                                <td>
                                    ${evento.endereco.local}
                                </td>
                                <td>
                                    <a href="EnderecoServlet?cmd=excluir&id=${evento.id}">Excluir</a>
                                </td>
                            </tr>
                        </c:forEach>
                    </table>
                </c:if>
                <c:if test="${!empty msg}">
                    <script type="text/javascript">
                        alert('${msg}');
                    </script>
                </c:if>

            </form>
        </div>
    </body>
</html>